package com.example.blenderandroid;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.widget.FrameLayout;

public class SplashActivity extends Activity {
	// amount of time (milliseconds) for splash screen to remain onscreen
	private static final int SPLASH_DELAY = 1000;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        
        FrameLayout frameLayout = (FrameLayout) findViewById(R.id.splash_layout);
        frameLayout.setBackgroundColor(Color.BLACK);
        
        // set up a timer to start the app's home screen
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent i = new Intent(SplashActivity.this, View3DActivity.class);
//                Intent i = new Intent(SplashActivity.this, MainActivity.class);
                SplashActivity.this.startActivity(i);
                SplashActivity.this.finish();
            }
        }, SPLASH_DELAY);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}
